package cn.dg.manager.base.consts;

import java.util.Map;
import java.util.TreeMap;

import org.springframework.context.ApplicationContext;

/**
 * 项目名称：
 * 
 * @author:duzh 修改日期：2015/11/2
 */
public class Const {
	public static final String SESSION_SECURITY_CODE = "sessionSecCode";// 验证码
	public static final String SESSION_USER = "sessionUser"; // session用的用户
	public static final String SESSION_ROLE_RIGHTS = "sessionRoleRights";
	public static final String sSESSION_ROLE_RIGHTS = "sessionRoleRights";
	public static final String SESSION_menuList = "menuList"; // 当前菜单
	public static final String SESSION_allmenuList = "allmenuList"; // 全部菜单
	public static final String SESSION_QX = "QX";
	public static final String SESSION_userpds = "userpds";
	public static final String SESSION_USERROL = "USERROL"; // 用户对象
	public static final String SESSION_USERNAME = "USERNAME"; // 用户名
	public static final String SESSION_DEALER = "dealer"; // 经销商
	public static final String TRUE = "T";
	public static final String AROUNDKM = "50";
	public static final String FALSE = "F";
	public static final String LOGIN = "/login_toLogin.do"; // 登录地址
	public static final String SYSNAME = "admin/config/SYSNAME.txt"; // 系统名称路径
	public static final String PAGE = "admin/config/PAGE.txt"; // 分页条数配置路径
	public static final String EMAIL = "admin/config/EMAIL.txt"; // 邮箱服务器配置路径
	public static final String SMS1 = "admin/config/SMS1.txt"; // 短信账户配置路径1
	public static final String SMS2 = "admin/config/SMS2.txt"; // 短信账户配置路径2
	public static final String SMS3 = "admin/config/SMS3.txt"; // 短信账户配置路径3
	public static final String FWATERM = "admin/config/FWATERM.txt"; // 文字水印配置路径
	public static final String IWATERM = "admin/config/IWATERM.txt"; // 图片水印配置路径
	public static final String WEIXIN = "admin/config/WEIXIN.txt"; // 微信配置路径
	public static final String WEBSOCKET = "admin/config/WEBSOCKET.txt";// WEBSOCKET配置路径
	public static final String FILEPATHIMG = "uploadFiles/uploadImgs/"; // 图片上传路径
	public static final String FILEPATHFILE = "uploadFiles/file/"; // 文件上传路径
	public static final String FILEPATH = "admin/config/FILEPATH.txt";
	public static final String FILEPATHTWODIMENSIONCODE = "uploadFiles/twoDimensionCode/"; // 二维码存放路径
	public static final String NO_INTERCEPTOR_PATH = ".*/((login)|(logout)|(code)|(app)|(weixin)|(static)|(main)|(websocket)|(regist)|(forget)|(hasN)|(hasE)|(getPM)|(saveUs)|(getArea)|(getDealers)|(getPE)).*"; // 不对匹配该值的访问路径拦截（正则）
	public static ApplicationContext WEB_APP_CONTEXT = null; // 该值会在web容器启动时由WebAppContextListener初始化
	public static final long verificationCodeTerm = 1800000; // 验证码有效期30分钟（单位：毫秒）
	public static final String PILETYPEA = "1011"; // 快充
	public static final String PILETYPEB = "1012"; // 慢充
	public static final String PILESTATUS_NORMAL = "20"; // 正常（空闲）
	public static final String PILESTATUS_ERROR = "30"; // 故障
	public static final String PILESTATUS_BUSY = "10"; // 使用中
	public static final String CHARGING_STATUS_PAY = "0"; // 待支付
	public static final String CHARGING_STATUS_SUCCESS = "1"; // 已完成
	public static final String CHARGING_STATUS_CHARGING = "2"; // 充电中
	public static final String PILE_STATUS_OFF = "40";  // 桩未开机
	public static final String PILE_STATUS_NORMAL = "20";  // 桩正常（空闲）
	public static final String PILE_STATUS_CHARGING = "10";  // 充电中
	public static final String PILE_STATUS_CHARGEOVER = "50";  // 充电结束
	public static final String PILE_STATUS_ERROR = "30"; //桩故障
	public static final String CHARGING_OVER = "充电完成";  //充电完成
	public static final String PILE_BREAKDOWN = "充电桩故障";  //充电桩故障
	
	// json 返回值
	public static final String RESULT_JSON_SUCCESS = "0";
	public static final String RESULT_JSON_ERROR = "-1";
	
	/**
	 * APP Constants
	 */
	// app注册接口_请求协议参数)
	public static final String[] APP_REGISTERED_PARAM_ARRAY = new String[] { "countries", "uname", "passwd", "title",
			"full_name", "company_name", "countries_code", "area_code", "telephone", "mobile" };
	public static final String[] APP_REGISTERED_VALUE_ARRAY = new String[] { "国籍", "邮箱帐号", "密码", "称谓", "名称", "公司名称",
			"国家编号", "区号", "电话", "手机号" };

	// app根据用户名获取会员信息接口_请求协议中的参数
	public static final String[] APP_GETAPPUSER_PARAM_ARRAY = new String[] { "USERNAME" };
	public static final String[] APP_GETAPPUSER_VALUE_ARRAY = new String[] { "用户名(手机号)" };
	// app用户登录接口_请求协议中的参数
	public static final String[] APP_USERLOGIN_PARAM_ARRAY = new String[] { "USERNAME", "PASSWORD" };
	public static final String[] APP_USERLOGIN_VALUE_ARRAY = new String[] { "用户名(手机号)", "密码" };
	// app修改密码接口_请求协议中的参数
	public static final String[] APP_CHANGEAPPUSERPWD_PARAM_ARRAY = new String[] { "USERNAME", "PASSWORD",
			"NEWPASSWORD" };
	public static final String[] APP_CHANGEAPPUSERPWD_VALUE_ARRAY = new String[] { "用户名(手机号)", "密码", "新密码" };
	// app用户注册接口_请求协议中的参数
	public static final String[] APP_USERREGISTER_PARAM_ARRAY = new String[] { "USERNAME", "PASSWORD", "NAME" };
	public static final String[] APP_USERREGISTER_VALUE_ARRAY = new String[] { "用户名(手机号)", "密码", "昵称" };
	// app用户信息保存接口_请求协议中的参数
	public static final String[] APP_EDITAPPUSERINFO_PARAM_ARRAY = new String[] { "USER_ID", "USERNAME", "NAME", "BZ",
			"EMAIL" };
	public static final String[] APP_EDITAPPUSERINFO_VALUE_ARRAY = new String[] { "用户编号", "用户名(手机号)", "姓名", "备注",
			"电子邮箱" };
	// app发送短信验证_请求协议中的参数
	public static final String[] APP_SENDSMS_PARAM_ARRAY = new String[] { "PHONENUMBER" };
	public static final String[] APP_SENDSMS_VALUE_ARRAY = new String[] { "电话号码" };
	// app检查短信验证码_请求协议中的参数
	public static final String[] APP_CHECKVERCODE_PARAM_ARRAY = new String[] { "PHONENUMBER", "MSGVERIFICATIONCODE" };
	public static final String[] APP_CHECKVERCODE_VALUE_ARRAY = new String[] { "电话号码", "短信验证码" };
	// app用户修改头像接口
	public static final String[] APP_EDITAPPUSERIMAGE_PARAM_ARRAY = new String[] { "USER_ID", "IMAGE" };
	public static final String[] APP_EDITAPPUSERIMAGE_VALUE_ARRAY = new String[] { "用户编号", "头像图片" };
	// 获取附近充电站接口
	public static final String[] APP_FINDAROUNDSTATION_PARAM_ARRAY = new String[] { "LAT", "LON" };
	public static final String[] APP_FINDAROUNDSTATION_VALUE_ARRAY = new String[] { "纬度", "经度" };
	// 获取最近一次使用的充电站接口
	public static final String[] APP_GETLASTESTSTATION_PARAM_ARRAY = new String[] { "USER_ID" };
	public static final String[] APP_GETLASTESTSTATION_VALUE_ARRAY = new String[] { "用户编号" };
	// 获取选择的充电张详细信息接口
	public static final String[] APP_GETSTATIONDETAIL_PARAM_ARRAY = new String[] { "STATION_ID" };
	public static final String[] APP_GETSTATIONDETAIL_VALUE_ARRAY = new String[] { "充电站编号" };
	// 按条件查询充电站信息
	public static final String[] APP_SEARCHSTATION_PARAM_ARRAY = new String[] { "KEYWORD", "INTERFACETYPE",
			"PILETYPE" };
	public static final String[] APP_SEARCHSTATION_VALUE_ARRAY = new String[] { "关键字", "接口类型", "充电桩类型" };
	// 查找充电（账单）记录
	public static final String[] APP_FINDORDER_PARAM_ARRAY = new String[] { "USERNAME", "currentPage" };
	public static final String[] APP_FINDORDER_VALUE_ARRAY = new String[] { "用户名(手机号)", "当前页" };

	// 查找未支付订单信息
	public static final String[] APP_GETORDERUNPAID_PARAM_ARRAY = new String[] { "USERNAME" };
	public static final String[] APP_GETORDERUNPAID_VALUE_ARRAY = new String[] { "用户名(手机号)" };

	// 支付成功通知服务端
	public static final String[] APP_PAYSUCCESS_PARAM_ARRAY = new String[] { "ORDER_ID", "USER_ID" };
	public static final String[] APP_PAYSUCCESS_VALUE_ARRAY = new String[] { "订单号", "用户编号" };

	// 扫码获取充电桩信息
	public static final String[] APP_GETPILEDETAIL_PARAM_ARRAY = new String[] { "MACID", "USERNAME" };
	public static final String[] APP_GETPILEDETAIL_VALUE_ARRAY = new String[] { "Mac唯一ID", "用户名(手机号)" };

	// 结束充电更新订单状态
	public static final String[] APP_UPDORDER_PARAM_ARRAY = new String[] { "PILE_ID", "USER_ID" };
	public static final String[] APP_UPDORDER_VALUE_ARRAY = new String[] { "充电桩编号", "用户编号" };

	// 开始充电
	public static final String[] APP_CDBEGIN_PARAM_ARRAY = new String[] { "MACID", "USER_ID", "PRICE" };
	public static final String[] APP_CDBEGIN_VALUE_ARRAY = new String[] { "Mac唯一ID", "用户编号", "价格" };

	// 忘记密码
	public static final String[] APP_FORGETPWD_PARAM_ARRAY = new String[] { "USERNAME", "NEWPASSWORD" };
	public static final String[] APP_FORGETPWD_VALUE_ARRAY = new String[] { "用户名(手机号)", "新密码" };

	// 获取使用过的电站列表
	public static final String[] APP_GETUSEDSTATION_PARAM_ARRAY = new String[] { "USER_ID" };
	public static final String[] APP_GETUSEDSTATION_VALUE_ARRAY = new String[] { "用户编号" };

	// 旧手机未停用的情况下，会员绑定新手机号
	public static final String[] APP_EDITUSERNAME_PARAM_ARRAY = new String[] { "USER_ID", "NEWUSERNAME",
			"MSGVERIFICATIONCODE" };
	public static final String[] APP_EDITUSERNAME_VALUE_ARRAY = new String[] { "会员编号", "新手机号", "验证码" };

	// 用户修改昵称
	public static final String[] APP_EDITNAME_PARAM_ARRAY = new String[] { "USER_ID", "NAME" };
	public static final String[] APP_EDITNAME_VALUE_ARRAY = new String[] { "会员编号", "昵称" };

	// 批量更新桩信息
	public static final String[] APP_UPDATEPILESTATUS_PARAM_ARRAY = new String[] { "JSON" };
	public static final String[] APP_UPDATEPILESTATUS_VALUE_ARRAY = new String[] { "桩信息" };
	
	// 检查用户名（手机号）是否被占用
	public static final String[] APP_CHECKAPPUSER_PARAM_ARRAY = new String[] { "USERNAME" };
	public static final String[] APP_CHECKAPPUSER_VALUE_ARRAY = new String[] { "用户名(手机号)" };

	//检查是否是最新版本
	public static final String[] APP_VERSION_PARAMETER_ARRAY = new String[] {"CODE"};
	public static final String[] APP_VERSION_VALUE_ARRAY = new String[] {"版本CODE"};
	
	//查找正在充电中的订单
	public static final String[] APP_CHARGING_PARAMETER_ARRAY = new String[] {"USERNAME"};
	public static final String[] APP_CHARGING_VALUE_ARRAY = new String[] {"用户名（手机号）"};
	
	//订单状态更新
	public static final String[] APP_UPDATEORDERSTATUS_PARAM_ARRAY = new String[] {"JSON"};
	public static final String[] APP_UPDATEORDERSTATUS_VALUE_ARRAY = new String[] {"桩信息"};
	
	//消息
	public static final String[] APP_MESSAGE_PARAM_ARRAY = new String[] {"USERID", "currentPage"};
	public static final String[] APP_MESSAGE_VALUE_ARRAY = new String[] {"用户ID", "当前页"};
	
	// APP_ERROR_CODE
	public static final String APP_ERROR_CODE_00 = "00"; // 请求失败
	public static final String APP_ERROR_CODE_01 = "01"; // 请求成功
	public static final String APP_ERROR_CODE_02 = "02"; // 返回空值
	public static final String APP_ERROR_CODE_03 = "03"; // 请求协议参数不完整
	public static final String APP_ERROR_CODE_04 = "04"; // 手机号或密码错误
	public static final String APP_ERROR_CODE_05 = "05"; // FKEY验证失败
	public static final String APP_ERROR_CODE_06 = "06"; // 已经存在该手机号码
	public static final String APP_ERROR_CODE_07 = "07"; // 新旧密码一样
	public static final String APP_ERROR_CODE_08 = "08"; // 手机号码或密码为空
	public static final String APP_ERROR_CODE_09 = "09"; // 验证码错误
	public static final String APP_ERROR_CODE_10 = "10"; // 验证码过期或无效
	public static final String APP_ERROR_CODE_11 = "11"; // 无效手机号码
	public static final String APP_ERROR_CODE_12 = "12"; // 密码长度不能大于255个字符
	public static final String APP_ERROR_CODE_13 = "13"; // 无效电子邮箱
	public static final String APP_ERROR_CODE_14 = "14"; // 验证码应为6位数字
	public static final String APP_ERROR_CODE_15 = "15"; // 图片路径不能大于500个字符
	public static final String APP_ERROR_CODE_16 = "16"; // 文件上传失败
	public static final String APP_ERROR_CODE_17 = "17"; // 您附近暂时没有充电站
	public static final String APP_ERROR_CODE_18 = "18"; // 无效用户
	public static final String APP_ERROR_CODE_19 = "19"; // 尚未在任何充电站充过电
	public static final String APP_ERROR_CODE_20 = "20"; // 您暂时没有待支付的订单
	public static final String APP_ERROR_CODE_21 = "21"; // 未查到充电账单记录
	public static final String APP_ERROR_CODE_22 = "22"; // 请登录
	public static final String APP_ERROR_CODE_23 = "23"; // 您有待支付的订单
	public static final String APP_ERROR_CODE_24 = "24"; // 这台充电桩有故障，请换台充电桩
	public static final String APP_ERROE_CODE_25 = "25"; // 请选择头像
	public static final String APP_ERROE_CODE_26 = "26"; // 支付成功
	public static final String APP_ERROR_CODE_27 = "27"; // 充电完成,请支付账款
	public static final String APP_ERROR_CODE_28 = "28"; // 请输入昵称
	public static final String APP_ERROR_CODE_29 = "29"; // 新手机已被绑定
	public static final String APP_ERROR_CODE_30 = "30"; // 成功修改绑定手机号
	public static final String APP_ERROR_CODE_31 = "31"; // 绑定用户手机号失败
	public static final String APP_ERROR_CODE_32 = "32"; // 确认密码与新密码不一致
	public static final String APP_ERROR_CODE_33 = "33"; // 该昵称已经使用过，请重新取昵称
	public static final String APP_ERROR_CODE_34 = "34"; // 该充电桩已故障，请选择其他充电桩
	public static final String APP_ERROR_CODE_35 = "35"; //CODE不能为空
	public static final String APP_ERROR_CODE_36 = "36"; //该版本不是最新版本，请通过下面的URL下载最新版
	public static final String APP_ERROR_CODE_37 = "37"; //该版本已是最新版本
	public static final String APP_ERROR_CODE_38 = "38"; //该版本大于服务器最新版本
	public static final String APP_ERROR_CODE_39 = "39"; //该充电桩正在充电
	public static final String APP_ERROR_CODE_40 = "40"; //桩未开机
	public static final String APP_ERROR_CODE_41 = "41"; //无正在充电中的订单
	public static final String APP_ERROR_CODE_42 = "42"; //没有用户可以推送消息
	public static final String APP_ERROR_CODE_43 = "43"; //当前页数超出总页数
	
	
	public final static Map<String, String> errorMsgMap = new TreeMap<String, String>() {
		private static final long serialVersionUID = 1L;
		{
			put(APP_ERROR_CODE_00, "请求失败。");
			put(APP_ERROR_CODE_01, "请求成功。");
			put(APP_ERROR_CODE_02, "返回空值。");
			put(APP_ERROR_CODE_03, "请求协议参数不完整。");
			put(APP_ERROR_CODE_04, "手机号或密码错误。");
			put(APP_ERROR_CODE_05, "FKEY验证失败。");
			put(APP_ERROR_CODE_06, "该手机号码已经被注册。");
			put(APP_ERROR_CODE_07, "新旧密码一样。");
			put(APP_ERROR_CODE_08, "密码不能为空。");
			put(APP_ERROR_CODE_09, "验证码错误。");
			put(APP_ERROR_CODE_10, "验证码过期或无效。");
			put(APP_ERROR_CODE_11, "无效手机号码。");
			put(APP_ERROR_CODE_12, "密码长度不能大于255个字符。");
			put(APP_ERROR_CODE_13, "无效电子邮箱。");
			put(APP_ERROR_CODE_14, "验证码应为6位数字。");
			put(APP_ERROR_CODE_15, "图片路径不能大于500个字符");
			put(APP_ERROR_CODE_16, "文件上传失败");
			put(APP_ERROR_CODE_17, "您附近暂时没有充电站");
			put(APP_ERROR_CODE_18, "无效用户");
			put(APP_ERROR_CODE_19, "尚未在任何充电站充过电");
			put(APP_ERROR_CODE_20, "您暂时没有待支付的订单");
			put(APP_ERROR_CODE_21, "未查到充电账单记录");
			put(APP_ERROR_CODE_22, "请登录");
			put(APP_ERROR_CODE_23, "您有待支付的订单");
			put(APP_ERROR_CODE_24, "这台充电桩有故障，请换台充电桩");
			put(APP_ERROE_CODE_25, "请选择头像");
			put(APP_ERROE_CODE_26, "支付成功");
			put(APP_ERROR_CODE_27, "充电完成，请支付账款");
			put(APP_ERROR_CODE_28, "请输入昵称");
			put(APP_ERROR_CODE_29, "新手机已被绑定");
			put(APP_ERROR_CODE_30, "成功修改绑定手机号");
			put(APP_ERROR_CODE_31, "绑定用户手机号失败");
			put(APP_ERROR_CODE_32, "确认密码与新密码不一致");
			put(APP_ERROR_CODE_33, "该昵称已经使用过，请重新取昵称");
			put(APP_ERROR_CODE_34,"该充电桩已故障，请选择其他充电桩");
			put(APP_ERROR_CODE_35, "CODE不能为空");
			put(APP_ERROR_CODE_36, "该版本不是最新版本，请通过下面的URL下载最新版");
			put(APP_ERROR_CODE_37, "该版本已是最新版本");
			put(APP_ERROR_CODE_38, "该版本大于服务器最新版本，请检查CODE是否正确");
			put(APP_ERROR_CODE_39, "该充电桩正在充电");
			put(APP_ERROR_CODE_40, "桩未开机");
			put(APP_ERROR_CODE_41, "无正在充电中的订单");
			put(APP_ERROR_CODE_42, "没有用户可以推送消息");
			put(APP_ERROR_CODE_43, "当前页数超出总页数");
		}
	};
}
